{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f28\fnil\fcharset0\fprq0{\*\panose 00000000000000000000}Calibri;}
{\f166\froman\fcharset238\fprq2 Times New Roman CE;}{\f167\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f169\froman\fcharset161\fprq2 Times New Roman Greek;}{\f170\froman\fcharset162\fprq2 Times New Roman Tur;}
{\f171\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f172\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f173\froman\fcharset186\fprq2 Times New Roman Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;
\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;
\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}}
{\info{\author Russell Reeves}{\operator Russell Reeves}{\creatim\yr2011\mo11\dy27\hr20\min36}{\revtim\yr2011\mo11\dy27\hr20\min38}{\version2}{\edmins2}{\nofpages1}{\nofwords238}{\nofchars1359}{\*\company RR}{\nofcharsws1668}{\vern8269}}
\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl \fet0\sectd \linex0\sectdefaultcl 
{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5
\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\sa200\sl276\slmult1\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
\f28\fs22\lang9\langfe1033\langnp9 Operating System Code Design Report
\par Design Decisions:
\par \tab We have buffers of the necessary size for user commands to the robot;
 if another command is entered before the first is processed then that new command will not be processed. This buffer size was chosen on the assumption that users won't enter commands at a faster 
rate than those commands can processed. If commands are entered faster than commands can be processed, then those additional commands are ignored. 
\par Deadlocks: 
\par \tab We address the problem of possible deadlocks by having the thread necessary to unlock our mutexes not require any mutex locks to run, this way when a thread locks it is guaranteed to be freed eventually.
\par Race Conditions:
\par \tab We eliminate race conditions by requiring that the robot to respond to the last command given to it before moving to process the 
next one. We also have all the IO in one thread, so that there is never a problem of multiple threads writting at the same time. We stop reading multiple commands at once by having a mutex lock out the thread that responds to commands until that command h
as been processed. 
\par Shared Information:
\par \tab Both the thread for processing user commands and the thread for requesting buffer information at the right time need to use the same serial port connection to opperate. To handle the sharing of this port we have all 
reading and righting to it in a seperate thread. The work threads change the value of a global variable and have what they need to write in global variables. The simultaneous
 update to either of the global variables is blocked by the same mutex that controls when to access the buffer for that function.
\par }}